CMAKE_MINIMUM_REQUIRED(VERSION 3.0)

PROJECT(DemoQt)

set(CMAKE_RUNTIME_OUTPUT_DIRECTORY ${PROJECT_SOURCE_DIR}/bin)
set(CMAKE_ARCHIVE_OUTPUT_DIRECTORY ${PROJECT_SOURCE_DIR}/lib)
set(CMAKE_LIBRARY_OUTPUT_DIRECTORY ${PROJECT_SOURCE_DIR}/lib)


if (MSVC)
    #warning 4251
    SET(CMAKE_CXX_FLAGS "${CMAKE_CXX_FLAGS} /wd4819 /wd4996 ")
    
    set(CMAKE_RUNTIME_OUTPUT_DIRECTORY_DEBUG ${PROJECT_SOURCE_DIR}/bin)
    set(CMAKE_ARCHIVE_OUTPUT_DIRECTORY_DEBUG ${PROJECT_SOURCE_DIR}/lib)
    set(CMAKE_LIBRARY_OUTPUT_DIRECTORY_DEBUG ${PROJECT_SOURCE_DIR}/lib)

    set(CMAKE_RUNTIME_OUTPUT_DIRECTORY_RELEASE ${PROJECT_SOURCE_DIR}/bin)
    set(CMAKE_ARCHIVE_OUTPUT_DIRECTORY_RELEASE ${PROJECT_SOURCE_DIR}/lib)
    set(CMAKE_LIBRARY_OUTPUT_DIRECTORY_RELEASE ${PROJECT_SOURCE_DIR}/lib)
   
endif()


if (CMAKE_PREFIX_PATH)
else()
    set (CMAKE_PREFIX_PATH $ENV{CMAKE_PREFIX_PATH})
    if (NOT CMAKE_PREFIX_PATH)
    set (CMAKE_PREFIX_PATH /home/terry/Qt5.8.0/5.8/gcc_64)
    endif()
endif()

message("qt: ${CMAKE_PREFIX_PATH}")


set(PROJECT_ROOT ${PROJECT_SOURCE_DIR})
set(THIRD_PARTY ${PROJECT_ROOT}/third_party)

if (CMAKE_HOST_WIN32)
    set(LIB_PLATFORM ws2_32 )
else()
    set(LIB_PLATFORM pthread rt)
endif()

set(CMAKE_INCLUDE_CURRENT_DIR ON)
set(CMAKE_AUTOMOC ON)
set(CMAKE_AUTOUIC ON)
set(CMAKE_AUTORCC ON)

find_package(Qt5Widgets REQUIRED)



add_subdirectory(demo)
add_subdirectory(democonsole)
add_subdirectory(demoLang)
add_subdirectory(demoOp)
add_subdirectory(demoui)

